<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Grid 响应式</title>
    <style>
        .container {
            display: grid;
            grid-gap: 5px;
            grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
            grid-template-rows: repeat(auto-fit, 200px);
        }
        .container > div > img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    </style>
</head>
<body>
    <div class="container">
            <div><img src="../images/11.jpg" alt=""></div>
            <div><img src="../images/11.jpg" alt=""></div>
            <div><img src="../images/11.jpg" alt=""></div>
            <div><img src="../images/11.jpg" alt=""></div>
            <div><img src="../images/11.jpg" alt=""></div>
            <div><img src="../images/11.jpg" alt=""></div>
    </div>
</body>
</html>